<style> 
    #uploadButton, .uploadButton {
        width: 108px;
        height: 28px;
        background-image: url(__PUBLIC__/dwz146/uploadify/img/uploadify-upload.png);
        display: block;
    }
    
    #urls dt {
        width: 250px;
    }
    
    #urls dl input {
        width: 220px;
    }
    
    /*.image .uploadify-button,.image .uploadify:hover .uploadify-button{
     background:none;
     border:none;
     }*/ 
</style>
<script type="text/javascript">
                                        	<?php $timestamp = time();?>
                                        	$(function() {
                                        		$('#file_upload').uploadify({
                                        			//校验数据
                                        			<php>
                                        			$timestamp=time();
                                        			</php>
                                        			'formData'     	: {
                                        				'timestamp' : '<?php echo $timestamp;?>',
                                        				'sess_id' : '<?php echo session_id();?>',
                                        				'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'//声明令牌
                                        			},
                                        			'swf'         	:'__PUBLIC__/dwz146/uploadify/scripts/uploadify.swf',//指定上传控件的主体文件，默认‘uploader.swf’
                                        			'uploader'    	:'{:U("Sys/file_uploads")}',//指定服务器端上传处理文件，默认‘upload.php’
                                        			'auto'        	:false,//手动上传
                                        			'scriptData': { 'sess_id': '<?php echo session_id();?>'},
                                        			'buttonImage' 	:'__PUBLIC__/dwz146/uploadify/img/uploadify-browse.png',//浏览按钮背景图片
                                        			'multi'       	:true,//单文件上传
                                        			'fileTypeExts'  :'*.gif; *.jpg; *.png; *.jpeg',//允许上传的文件后缀
                                        			'fileSizeLimit' :'300MB',//上传文件的大小限制，单位为B, KB, MB, 或 GB
                                        			'successTimeout':30,
                                        			'onUploadSuccess':function(file, data, response){
                                        				var html='<dl class="nowrap">';
                                                        html+='<dt><input type="hidden" name="picsname[]" value="'+file.name+'"></dt>';
                                                        html+='<dd>'+file.name+' <a target="_blank" href="'+data+'" rel="filename">&nbsp;查看</a> <br/>图片标题：<input name="title[]" type="text" /> <br />  链接地址：<input name="link[]" type="text" /> <input name="pics[]" value="'+data+'" type="hidden"/>  </dd>';
                                                        html+='</dl>';
                                        	            $('#urls').append(html);
                                        	        },
                                        	        'onUploadError':function(file, data, response){
                                        	            $('#urls').append("<li>"+data+"</li>");
                                        	        },
                                        		});
                                        		
                                        		$("#upimagebnt").uploadify({
                                        			'swf'         	:'__PUBLIC__/dwz146/uploadify/scripts/uploadify.swf',
                                        			'uploader'    	:'{:U("Sys/upload")}',
                                        			'auto'        	:true,
                                        			'formData'     	: {
                                        				'sess_id' : '<?php echo session_id();?>',
                                        			},
                                        			'fileTypeExts'  :'*.gif; *.jpg; *.png; *.jpeg',
                                        			'fileSizeLimit' :'300KB',//上传文件的大小限制，单位为B, KB, MB, 或 GB
                                        			'successTimeout':30,
                                        			//'buttonClass':'uploadButton',
                                        			'buttonText':'上传文件',
                                        			'multi'         :false,//单文件上传
                                    				'width'    : 60,
                                    				'height': 18,
                                        			'onUploadSuccess':function(file, data, response){
                                        				$("#upimage").val(data);
        												$("#main_img").attr("src",data);
                                        				//html=' <a target="_blank" href="'+data+'">查看</a>';
                                        				//$('#upimagedd').append(html);
                                        	        },
                                        	        'onUploadError':function(file, data, response){
                                        				alert(data+'上传失败，请重试');
                                        	        }
                                        		});
                                        	});
</script>
<div class="pageContent">
    <form method="post" id="Content_insert" action="{:U('Sys/banner_insert',array('proid'=>$proid))}" onsubmit="return validateCallback(this,navTabAjaxDone);">
        <div class="pageFormContent" layoutH="52">
            <div class="tabs" currentIndex="0" eventType="click">
                <div class="tabsHeader">
                    <div class="tabsHeaderContent">
                        <ul>
                            
                            <li>
                                <a href="javascript:;"><span>图片</span></a>
                            </li>
                            
                        </ul>
                    </div>
                </div>
                <div class="tabsContent" layoutH="82">

                    <div id="product_img">

                        <fieldset>
                            <legend>
                                图片上传
                            </legend>
                          
						  <dl class="nowrap">
                                <dt>
                                	幻灯片类型
                                </dt>
                                <dd>
                                	<select name='fid'>
                                		<volist name='slides' id='slide'>
                                			<option value='{$slide.id}'>{$slide.name}</option>
                                		</volist>
                                	</select>
                                </dd>
                            </dl>
							
						
						  <div id="urls">
                            </div>
                            <dl class="nowrap">
                                <dt>
                                	幻灯片
                                </dt>
                                <dd>
                                    <input id="file_upload" name="file_upload" type="file" multiple="true"><a href="javascript:$('#file_upload').uploadify('upload','*')" id="uploadButton"></a>
                                </dd>
                            </dl>
                        </fieldset>
                    </div>

                </div>
            </div>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit" onclick="return validateCallback($('#Content_insert'),navTabAjaxDone);">
                                保存
                            </button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">
                                取消
                            </button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script>
    $(function(){
        //删除组图
        $(".del_gimg").click(function(){
            var id = $(this).attr('gimgid');
            //定义处理方法    
            var _submitFn = function(){
                var url = "{:U('Content/del_groupimg')}";
                $.post(url, {
                    id: id
                }, function handel(res){
                    if (res) {
                        $("#gimg" + id).hide();
                    }
                });
            }
            //确认是否删除
            alertMsg.confirm('确定删除?', {
                okCall: _submitFn
            });
            
        });
        
    });
</script>
